package com.itheima.SmartHome;

import java.util.Scanner;

public class test
{
    public static void main(String[] args) {
        JD []jd=new JD[4];
        jd[0]=new Washmachin("美的洗衣机", true);
        jd[1]=new TV("海信TV", false);
        jd[2]=new Lamp("LED灯泡", true);
        jd[3]=new Air("美的空调", true);
       //打印所有设备和他的状态
        //设置为单例类
        SmartControl sc=SmartControl.getInstance();
        sc.printAll(jd);
        System.out.println("您要按哪个开关");
        Scanner q = new Scanner(System.in);
        int index=q.nextInt();
        sc.control(jd[index-1]);
        sc.printAll(jd);
    }
}
